package svmc.stp.hoaitt;

public class Book implements Comparable<Book> {
	private String nameBook;
	private String nameAuth;
	int state;//0: not available, 1: available
	int indexOfBook;
	
	public Book(String _nameBook, String _nameAuth, int _indexOfBook) {
		this.nameBook = _nameBook;
		this.nameAuth = _nameAuth;
		this.indexOfBook = _indexOfBook;
		state = 1 ;
	}

	public String getNameBook() {
		return nameBook;
	}

	public void setNameBook(String nameBook) {
		this.nameBook = nameBook;
	}

	public String getNameAuth() {
		return nameAuth;
	}

	public void setNameAuth(String nameAuth) {
		this.nameAuth = nameAuth;
	}
	
	
	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}
	
	@Override
	public String toString() {
		return indexOfBook+" "+nameBook+" "+nameAuth+" "+state;
	}
	
	@Override
	public int compareTo(Book o) {
		return this.getNameBook().compareTo(o.getNameBook());
	}
}
